#include "conveyor.h"
#include "pickbusiness_global.h"
#include "item.h"


namespace PickBusiness
{

	/*Conveyor::Conveyor(QObject *parent)
		: QObject(parent)
	{

	}*/

	Conveyor::Conveyor()
	{

	}

	Conveyor::~Conveyor()
	{

	}

	bool Conveyor::createItem( QPoint aAtPosition )
	{
		bool retVal = false;

		if( aAtPosition.x() < mWidth && aAtPosition.y() < mHeight)
		{
			PickBusiness::Item item;
			item.Velocity(mVelocity);
			item.Position(aAtPosition);
			item.Width(20);
			item.Height(20);
			mItemList.push_back(item);
			retVal = true;
		}
		return retVal;

	}

	void Conveyor::updateItems()
	{
		for(short i = 0; i < mItemList.length(); i++)
		{
			mItemList[i].moveBy(mVelocity*gcDELTA_TIME);
		}
	}


}